<html>
<head><meta charset="utf-8"><title>ssa mir · t-compiler/wg-mir-opt · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/index.html">t-compiler/wg-mir-opt</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/ssa.20mir.html">ssa mir</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="238529034"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/ssa%20mir/near/238529034" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/ssa.20mir.html#238529034">(May 12 2021 at 19:15)</a>:</h4>
<p>Currently MIR is not in SSA form. This makes optimizations much harder. Would it be an idea to for each local store which if the local has one defining use, or multiple defining uses or has it's address taken? This would be a kind of hybrid SSA form, except without phi nodes. It would allow for easier copy propagation on locals with only a single defining use and ignoring locals with their address taken completely for certain optimizations. It may also allow for removing Storage* for all locals that don't have their address taken without hurting release mode codegen (I hope LLVM is smart enough). This would also reduce the total number of Storage* that may interfere with mir optimizations.</p>



<a name="238531349"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/ssa%20mir/near/238531349" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/ssa.20mir.html#238531349">(May 12 2021 at 19:33)</a>:</h4>
<p>It sounds useful.  How would it interact with loops or aliasing?</p>



<a name="238531377"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/ssa%20mir/near/238531377" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/ssa.20mir.html#238531377">(May 12 2021 at 19:33)</a>:</h4>
<p>I think there is a space to explore here, but we should probably eliminate storage markers first and compute them on the fly via dataflow. We'd keep some StorageDead (which would then be more of a KillBorrows)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>